<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            padding: 0;
            margin: 0;
        }
        .top {
            width: 195px;
            height: 80px;
            margin: 10px auto;
        }
        input {
            margin-bottom: 10px;
        }
    </style>
</head>
<body>
    <div class="top">
        <input type="text" value="北京市" id="inp">
        <input type="text" value="朝阳区" id="ipd">
        <button id="add">传参</button>
    </div>
</body>
<script>
    var inp = document.querySelector('#inp')
    var ipd = document.querySelector('#ipd')
    var add = document.querySelector('#add')
    add.onclick = function () {
        alert(inp.value)
        alert(ipd.value)
    }
</script>
</html>